[XEND] Fix bootable flag bypass in XendConfig
authorAlastair Tse <atse@xensource.com>
Tue, 30 Jan 2007 11:56:27 +0000 (11:56 +0000)
committerAlastair Tse <atse@xensource.com>
Tue, 30 Jan 2007 11:56:27 +0000 (11:56 +0000)
Signed-off-by: Alastair Tse <atse@xensource.com>
tools/python/xen/xend/XendConfig.py
tools/python/xen/xend/server/XMLRPCServer.py

index cc2655d60efae181c416ae36f6041819a9451bbd..5a6555e9c704a3bef2704fccc9b6affd1d4beea7 100644 (file)
@@ -881,10 +881,10 @@ class XendConfig(dict):
                             if sxp.name(config) in ('vbd', 'tap'):
                                 # The bootable flag is never written to the
                                 # store as part of the device config.
-                                uuid = sxp.child_value(sxpr, 'uuid')
-                                sxpr.append(
-                                    'bootable', 
-                                    self['devices'][dev_uuid]['bootable'])
+                                dev_uuid = sxp.child_value(config, 'uuid')
+                                dev_type, dev_cfg = self['devices'][dev_uuid]
+                                config.append(['bootable',
+                                               int(dev_cfg['bootable'])])
                             sxpr.append(['device', config])
 
                         found = True
index 722ccb4b2b4c451c08ca22d9736e6b88a2a0dc53..09a66549e9d836aeba7b3b8e4a614dae4e6fbfc4 100644 (file)
@@ -34,7 +34,7 @@ from xen.xend.XendError import XendInvalidDomain
 def fixup_sxpr(sexpr):
     ret = []
     for k in sexpr:
-        if type(k) in (types.ListType, types.TupleType):
+        if type(k) in (list, tuple):
             if len(k) != 2 or k[0] != 'vcpu_avail':
                 ret.append(fixup_sxpr(k))
         else: